Next | Prev | Up | Top | Contents | Index

ar Options

When running the archiver, specify exactly one of the options d, m, p, q, r, t, or x (listed in Table 2-12). In addition, you can optionally specify any of the modifiers in Table 2-13.

Archiver Options
Option Purpose
dDeletes the specified objects from the archive.
fAdds padding to the end of each object file archived, using the character \n. This enables the loader to have faster access to members in the archive while performing static linking. Warning: This option results in a permanent change in the size of object files.
pPrints the specified objects in the archive on the standard output device (usually the terminal screen).
qAdds the specified object files to the end of the archive. This option is similar to the r option (described below), but is faster and does not remove any older versions of the object files that may already be in the archive. Use the q option when creating a new library.
rAdds the specified object files to the end of the archive file. If an object file with the same name already exists in the archive, the new object file overwrites it. Use the r option when updating existing libraries.
tPrints a table of contents on the standard output (usually the screen) for the specified object or archive file.
xCopies the specified objects from the archive and places them in the current directory. Duplicate files are overwritten. The last modified date is the current date (unless you specify the o suboption, in which case the date stamp on the archive file is the last modified date). If no objects are specified, x copies all the library objects into the current directory.

Archiver Modifiers
Option Purpose
cSuppresses the warning message that the archiver issues when it discovers that the archive you specified does not already exist.
lPuts the archiver's temporary files in the current working directory. Ordinarily, the archiver puts those files in /tmp (unless the STMDIR environment variable is set, in which case ar stores temporary files in the directory indicated by that variable). This option is useful when /tmp (or STMDIR) is full.
sCreates a symbol table in the archive. This modifier is rarely necessary since the archiver updates the symbol table of the archive library automatically. Options p, q, and r, in particular, create a symbol table by default and thus do not require s to be specified.
vLists descriptive information during the process of creating or modifying the archive. When specified with the t option, produces a verbose table of contents.


Next | Prev | Up | Top | Contents | Index